//
//  EventDetailModel.m
//  ConvenientlyTake
//
//  Created by 森鑫 on 2022/12/23.
//

#import "EventDetailModel.h"

@implementation EventDetailModel

+ (NSDictionary *)modelContainerPropertyGenericClass {
    return @{@"videoList" : [VideoList class],
             @"disposeFileList" : [DisposeFileList class],
             @"pictureList" : [PictureList class],
             @"noDisposalFileList" : [NoDisposalFileList class],
             @"operations":[OperationsModel class],
    };
}

- (NSArray *)resultPictureList{
    NSMutableArray *array = [NSMutableArray array];
    for (PictureList *item in self.pictureList) {
        if ([item.filePath hasSuffix:@".jpg"] || [item.filePath hasSuffix:@".png"] || [item.filePath hasSuffix:@".jpeg"]) {
            [array addObject:item.filePath];
        }
    }
    return [array copy];
}
- (NSArray *)resultVideoList{
    NSMutableArray *array = [NSMutableArray array];
    for (VideoList *item in self.videoList) {
        if ([item.filePath hasSuffix:@".mp4"]) {
            [array addObject:item.filePath];
        }
    }
    return [array copy];
}

- (NSArray *)noDisposalPictureList{
    NSMutableArray *array = [NSMutableArray array];
    for (NoDisposalFileList *item in self.noDisposalFileList) {
        if ([item.filePath hasSuffix:@".jpg"] || [item.filePath hasSuffix:@".png"] || [item.filePath hasSuffix:@".jpeg"]) {
            [array addObject:item.filePath];
        }
    }
    return [array copy];
}

- (NSArray *)disposePictureList{
    NSMutableArray *array = [NSMutableArray array];
    for (DisposeFileList *item in self.disposeFileList) {
        if ([item.filePath hasSuffix:@".mp4"]) {
            [array addObject:item.filePath];
        }
    }
    return [array copy];
}

@end

@implementation Metadata


@end

@implementation OperationsModel
+ (NSDictionary *)modelContainerPropertyGenericClass {
    return @{@"metadata" : [Metadata class],
    };
}

@end

@implementation VideoList

@end

@implementation DisposeFileList

@end

@implementation PictureList


@end

@implementation NoDisposalFileList 


@end

@implementation RemarkFileList


@end

@implementation ServiceFileList


@end
@implementation EventLogModel

+ (NSDictionary *)modelContainerPropertyGenericClass {
    return @{@"remarkFileList" : [RemarkFileList class],
             @"serviceFileList" : [ServiceFileList class],
    };
}

+(NSDictionary *)modelCustomPropertyMapper{
    return @{@"operatorString" : @"operator"};
}

-(NSString *)getPromoterString{
    if(self.promoterType == 1) {
        return @" 市民 ";
    } else if (self.promoterType == 2) {
        return @" 实地调查组 ";
    }
    return @" 市民 ";
}

- (NSArray *)photoArray{
    NSMutableArray *array = [NSMutableArray array];
    for (ServiceFileList *item in self.serviceFileList) {
            [array addObject:item.filePath];
    }
    return [array copy];
}

@end
